﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MvcApplication.Controllers
{
	public class HomeController : Controller
	{
		public ActionResult Index()
		{
			ViewBag.Message = "Welcome to ASP.NET MVC!";

			return View();
		}

		[HttpPost]
		public ActionResult Index(string msg )
		{
			if (string.IsNullOrEmpty(msg)) msg = "";
			foreach(var pl in MvcApplication.ActivePlugins)
			{
				msg = pl.Process(msg);
			}
			ViewBag.Message = msg;
			return View();
		}

		public ActionResult About()
		{
			return View();
		}
	}
}
